import Home from '@/views/home/home.vue'
import Layout from '@/layout/content/index.vue'

const routes: RouteConfig[] = [
  {
    path: '/',
    isAside: true,
    meta: {
      icon: 'home',
      title: '首页'
    },
    component: Home
  },
  {
    path: '/board',
    isAside: true,
    module: 'board',
    auth: 'Board',
    meta: {
      icon: 'table',
      title: '栏目'
    },
    component: () => import('@/views/board/index.vue')
  },
  {
    path: '/auth',
    isAside: true,
    module: 'auth',
    auth: 'Auth',
    meta: {
      icon: 'table',
      title: '权限'
    },
    component: Layout,
    children: [
      {
        path: '',
        redirect: '/auth/user'
      },
      {
        path: 'user',
        meta: {
          title: '用户'
        },
        component: () => import('@/views/auth/user/index.vue')
      },
      {
        path: 'user/create',
        hidden: true,
        active: '/auth/user',
        meta: {
          title: '创建用户'
        },
        component: () => import('@/views/auth/user/create.vue')
      },
      {
        path: 'group',
        meta: {
          title: '用户组'
        },
        component: () => import('@/views/auth/user/index.vue')
      },
      {
        path: 'permissions',
        meta: {
          title: '权限节点'
        },
        component: () => import('@/views/auth/user/index.vue')
      }
    ]
  },
  {
    path: '/setting',
    isAside: true,
    module: 'setting',
    auth: 'Setting',
    meta: {
      icon: 'cog',
      title: '设置'
    },
    component: Layout,
    children: [
      {
        path: '',
        redirect: '/setting/base'
      },
      {
        path: 'base',
        meta: {
          title: '基础设置'
        },
        component: () => import('@/views/setting/base.vue')
      },
      {
        path: 'login',
        meta: {
          title: '后台登陆'
        },
        component: () => import('@/views/setting/login.vue')
      }
    ]
  }
]

export default routes
